home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1996 July
/
EnigmA AMIGA RUN 09 (1996)(G.R. Edizioni)(IT)[!][issue 1996-07 & 08][EARSAN CD VIII].iso
/
earcd
/
util3
/
wat.lha
/
WAT.Doc
< prev
next >
Wrap
Text File
|
1996-06-03
|
7KB
|
168 lines
WAT
---
Version 1.00 - June 1996
Copyright © Michael Tanzer 1996
+---------------------------------------------------------------------------+
| N O T I C E |
| |
| Freely distributable. Not to be used for commercial purposes without |
| written consent from the author. Not to be distributed without this |
| notice and accompanying components intact. |
| |
| This product is distributed on an 'as-is' basis, with no warranty of any |
| kind, either express or implied. No responsibility whatsoever is assumed |
| by the author for the use of this product, nor for any results of its |
| use. No claim whatsoever is made as to this product's accuracy, useful- |
| ness, completeness, nor suitability to any purpose. |
| |
| Components include the following files: |
| WAT |
| WAT.info |
| WAT.Doc (this document) |
| WAT.Doc.info |
| |
+---------------------------------------------------------------------------+
What's WAT?
-----------
WAT ('What?! Another Timer?!') is a timer utility written in Rexx.
Why WAT?
--------
WAT is a simple timer that displays the time it was started, the time it
was stopped, and the elapsed time in between. It has virtually no CPU
overheads while it is active because the only time it does anything is
when you stop it or restart it.
You can run multiple copies of WAT, and optionally specify a port name
so that other ARexx programs can tell WAT when to start, stop, or quit.
WAT runs asynchronously, so you can run it without tying up a shell.
Best of all, WAT is written in Rexx, so if you want to add or change a
feature, you can do it easily. And it's free.
What you need in order to use WAT:
----------------------------------
You must have the following libraries in your LIBS: directory:
rexxsyslib.library (version 36.17 or later)
rexxsupport.library (version 34.9 or later)
rexxarplib.library (version 3.0 or later)
arp.library (version 39.1 or later)
screenshare.library (version 1.46 or later - required only for WB1.3)
The RX and WaitForPort commands should be contained in a directory that is
in your default path. In WB2+ they are in the Rexxc directory.
How to implement WAT:
---------------------
Copy WAT to your REXX: directory. If you are running WB2 or later, make
sure the 'script' flag is set.
If you want to start WAT with an icon, copy WAT.info to the drawer of your
choice.
If you use a large font for screen text, you may find that the window title
overlays part of the window contents. In this case, try adding 1 or 2 to
the value of the 'blanks' variable at the beginning of the program.
How to use WAT:
---------------
To run WAT from the Workbench, double-click the WAT icon.
To run WAT from a WB2+ shell, enter:
WAT <portname>
From a WB1.3 shell, enter:
RX WAT <portname>
The WAT window displays the time at which WAT was started (or re-started),
the time at which it was stopped, and the elapsed time in between. Clicking
on the 'START' gadget will re-start the timer and clear the elapsed time.
Clicking on the 'STOP' gadget will cause the 'stopped' time to be updated
and the elapsed time to be calculated. The timer never actually stops, so
you can click on the 'STOP' gadget repeatedly, getting an updated display
each time. In order to minimise CPU utilisation, the elapsed time is not
updated automatically. If you're into watching numbers change, get a clock.
If you specify a port name, it will be displayed on WAT's window and menu.
If no port name is specified, 'WAT' will be used first, then 'WAT1', WAT2',
etc. depending on how many copies of WAT are already active. Note that
any port name specified will be converted to upper case before use.
The default position for the WAT window is in the upper left hand corner
of the screen, but you can change this by dragging the window to the your
preferred location and selecting 'Save prefs' from the menu. The screen
position will be stored in a configuration file ('S:WAT.config').
You can control WAT from another ARexx program by using the ADDRESS instruc-
tion to indicate the desired WAT notify port, then specifying one of the
following commands:
Command Action
------- ------
QUIT Terminates the WAT display
CLOSEWINDOW Terminates the WAT display
START Re-starts the timer
STOP Stops the timer
SPREF Stores the window position in the config file
For example, if you wanted to use WAT to display the time it took to run a
particular Rexx program, you could put the following lines at the beginning
of the program:
if wat(quack) then address command 'WAITFORPORT QUACK'
else do /* followed by logic to handle WAT failure */
Then at the end of the program, insert the following:
address quack 'STOP'
to cause the WAT window displaying the name 'QUACK' to show the time
elapsed during the running of the program. Of course, if your program was
written in Rexx, you'll probably use the time('r') and time('e') functions
instead of WAT, but the facility is there if you need it. Note that, if
called as a function, WAT will return a '1' or a '0' to indicate successful
or unsuccessful initialisation, respectively.
Version log:
------------
1.00 JUN 1996 Original release.
Other things you might like to know about WAT:
----------------------------------------------
Before you make any complicated changes, comment out the paragraph at the
top of the program having the comment 'Run WAT asynchronously' so that you
can insert trace commands, etc. as required (but leave in the call to
'getnport'), then invoke the test version from a shell. It may also be
advisable to comment out the 'signal on halt' and 'trace b' lines that
appear at the top of the main control loop.
You are free use WAT for as long as you like and to modify it in any way
that suits your needs, but please do not distribute a modified version. I
do not ask for any remuneration, but if you would like to send me anything
I would be delighted to receive it (all right, even another Porsche). I
will make a sincere effort to answer any questions you may have about WAT.
My address is:
Michael Tanzer
P.O. Box 289
Carlton North VIC 3054
Australia
Telephone: +61 3 9387 6589
Facsimile: +61 3 9388 1863